package com.yawn.demomybatis.controller;

import com.yawn.demomybatis.dao.SchoolDao;
import com.yawn.demomybatis.entity.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/school")
public class SchoolController {

    @Autowired
    private SchoolDao schoolDao;

    @GetMapping("/get")
    public School get(int id) {
        return schoolDao.get(id);
    }
}
